home *** CD-ROM | disk | FTP | other *** search
- Path: dialupline64.ghgcorp.com!user
- From: gastineau@ghgcorp.com (Brian Gastineau)
- Newsgroups: comp.lang.c++
- Subject: templates on VAX/VMS
- Date: Sun, 25 Feb 1996 16:24:01 -0500
- Organization: GHG Corporation
- Message-ID: <gastineau-2502961624010001@dialupline64.ghgcorp.com>
- NNTP-Posting-Host: 206.29.116.222
-
- I am trying to implement a linked list template out of the "C++ How to
- Program" textbook by Deitel & Deitel, 1994, page 697, on a VAX.
-
- The node template class is of the form:
-
- template<class NODETYPE>
- class ListNode {
- friend class List<NODETYPE>;
- public:
- ListNode(const NODETYPE &);
- NODETYPE getData() const;
- private:
- NODETYPE data;
- ListNode *nextPtr;
- };
-
- The list template class is of the form:
-
- template<class NODETYPE>
- class List {
- public:
- List();
- ~List();
- void insertAtFront(const NODETYPE &);
- void insertAtBack(const NODETYPE &);
- int removeFromFront(NODETYPE &);
- int removeFromBack(NODETYPE &);
- int isEmpty() const;
- void print() const;
- private:
- ListNode<NODETYPE> *firstPtr;
- ListNode<NODETYPE> *lastPtr;
- ListNode<NODETYPE> *getNewNode(const NODETYPE &);
- };
-
- All of the object function declaration have a related function body
- included in the same file. I've got some subroutines in other files that
- are compiling and linking OK, so I don't think that the problem lies with
- not including the files in the right way
-
- The driver uses the templates in the following lines:
-
- List<int> integerList;
- List<float> floatList;
-
- The code compiles OK, but during linking, the following errors are given:
-
- $ link driver
- %LINK-W-NUDFSYMS, 14 undefined symbols:
- %LINK-I-UDFSYM, INSERTATBACK__8LIST___FXNKF
- %LINK-I-UDFSYM, INSERTATBACK__8LIST___IXNKI
- %LINK-I-UDFSYM, INSERTATFRONT__8LIST___FXNKF
- %LINK-I-UDFSYM, INSERTATFRONT__8LIST___IXNKI
- %LINK-I-UDFSYM, PRINT__K8LIST___FXV
- %LINK-I-UDFSYM, PRINT__K8LIST___IXV
- %LINK-I-UDFSYM, REMOVEFROMBACK__8LIST___FXNF
- %LINK-I-UDFSYM, REMOVEFROMBACK__8LIST___IXNI
- %LINK-I-UDFSYM, REMOVEFROMFRONT__8LIST___FXNF
- %LINK-I-UDFSYM, REMOVEFROMFRONT__8LIST___IXNI
- %LINK-I-UDFSYM, __CT__8LIST___FXV
- %LINK-I-UDFSYM, __CT__8LIST___IXV
- %LINK-I-UDFSYM, __DT__8LIST___FXV
- %LINK-I-UDFSYM, __DT__8LIST___IXV
-
- I don't have access to any books or manuals besides the Deitel book. Any
- help would be appreciated.
-
- Thanks,
- Brian Gastineau
-